home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SOUND.SWG / 0012_VOC2LPT1.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  64 lines

  1. {
  2.     This is a Program to export a VOC or other Raw Sound File to a Parallel
  3. port DAC.. (only For LPT1 now, but i think you can make it work on LPT2 by
  4. changing the 'PORT[$0378]' to 'PORT[$0388]'...
  5.  
  6.  I know, This is a Real mess For figuring it out... I originally had no
  7. intention of posting it, but I believe in free access to info, so here it is!
  8. If you have any questions about it, just ask... and if you figure out where
  9. that bug is (you'll know what I mean, it only plays PART of the VOC) I'd
  10. appreciate input.
  11. }
  12.  
  13. {This Program Assumes you have a DAC on LPT1}
  14. {$M 65520,0,300000}          {only use memory that is needed}
  15. Program Voc_Play;
  16. Uses
  17.   Crt;
  18.  
  19. Procedure Wait(N : Word);        {Very Crude wait routine}
  20. Var
  21.   counter : Word;
  22. begin
  23.   For Counter:= 1 to N do;
  24. end;
  25.  
  26. Type Ra = Array[0..0] of Byte;
  27.  
  28. Var
  29.   I2   : ^Ra;
  30.   spd  : Integer;
  31.   res  : Word;
  32.   siz  : LongInt;
  33.   B    : Word;
  34.   s    : String;
  35.   f1   : File of Byte;
  36.   F    : File;
  37.  
  38. begin
  39.   Write('Enter Voc Filename: ');
  40.   readln(S);
  41.                              {Get Size of File}
  42.   Assign(f1,s);
  43.   Reset(f1);
  44.   spd:=30;                   {this is the play speed}
  45.   siz := FileSize(f1);
  46.   close(f1);
  47.                               {Load up Voc File}
  48.   Assign(f,s);
  49.   Reset(f);
  50.   getmem(I2,siz);               {Allocate Memory For VOC File}
  51.   BlockRead(f,I2^,siz,res);     {Load VOC into Memory)
  52.   Writeln('FileSize = ',siz);   {Testing Point, not needed}
  53.  
  54.   Repeat                      {This is the actual Play routine}      begin
  55.     For b:=0 to siz do
  56.     begin
  57.       Wait(spd);            {Wait a bit}
  58.       Port[$0378]:=I2^[b];  {Put Byte to DAC}
  59.     end;
  60.   end Until KeyPressed;
  61.  
  62. end.
  63.  
  64.